function [ snr ] = SNR_func( data_vector )
% Calculate the SNR of fMRI data
% (assumes the task off is between 0:17 and then 79:113 indexes, whilst
% task on is between 18:78 in the data)

% Create vector for the off period of the subject data
off_period = [data_vector(1:18); data_vector(78:113)];

% Calculate standard deviation for the off periods
standard_dev = std(off_period);

% Calculate mean amplitudes during task on
amp = mean(data_vector(18:78));

% Lastly calculate SNR of the subject
snr = 20*log10(amp/standard_dev);

end

